package com.common.ui.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class DataBaseHelp extends SQLiteOpenHelper {
    private static final String DATABASE_NAME = "note.db";  //数据库名字
    private static final int DATABASE_VERSION = 1;         //数据库版本号
    private static SQLiteDB mSQLiteDB;


    public DataBaseHelp(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }


    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql = "create table note(note_id INTEGER PRIMARY KEY AUTOINCREMENT ,title varchar(20)" +
                ",content TEXT,add_time DATETIME,update_time DATETIME,note_code TEXT)";
        db.execSQL(sql);

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }

    @Override
    public void onOpen(SQLiteDatabase db) {
        super.onOpen(db);
    }


}
